package com.adjy.pathbuilders.objects.button.listeners;

import android.widget.Toast;

import com.adjy.pathbuilders.state.Game;
import com.adjy.pathbuilders.world.Level;

public class LevelSetterButtonListener implements ButtonListener {
	
	private final Game game;
	private final Level level;
	
	public LevelSetterButtonListener(Game game, Level level) {
		this.game = game;
		this.level = level;
	}

	@Override
	public void onButtonPressed() {
		if(this.level.isEnabled()){
			game.startLevel(this.level);
		} else {
			Toast.makeText(game.getContext(), "You need to unlock this level", Toast.LENGTH_SHORT).show();
		}
	}
}